package jianzhi_offer;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-04-17 13:58
 */
public class _1_二维数组中的查找 {
    public boolean Find(int target, int [][] array) {
        for(int i=0;i<array.length;i++){
            int low=0;
            int high=array[i].length-1;
            while(low<=high){
                int mid=(low+high)/2;
                if(target>array[i][mid])
                    low=mid+1;
                else if(target<array[i][mid])
                    high=mid-1;
                else
                    return true;
            }
        }
        return false;
    }
}
